import 'package:flutter_test/flutter_test.dart';
import 'package:zx_flutter_network_manager/zx_flutter_network_manager.dart';
import 'package:zx_flutter_network_manager/zx_flutter_network_manager_platform_interface.dart';
import 'package:zx_flutter_network_manager/zx_flutter_network_manager_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockZxFlutterNetworkManagerPlatform
    with MockPlatformInterfaceMixin
    implements ZxFlutterNetworkManagerPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ZxFlutterNetworkManagerPlatform initialPlatform = ZxFlutterNetworkManagerPlatform.instance;

  test('$MethodChannelZxFlutterNetworkManager is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelZxFlutterNetworkManager>());
  });

  test('getPlatformVersion', () async {
    ZxFlutterNetworkManager zxFlutterNetworkManagerPlugin = ZxFlutterNetworkManager();
    MockZxFlutterNetworkManagerPlatform fakePlatform = MockZxFlutterNetworkManagerPlatform();
    ZxFlutterNetworkManagerPlatform.instance = fakePlatform;

    expect(await zxFlutterNetworkManagerPlugin.getPlatformVersion(), '42');
  });
}
